package com.aaa.multithreading.demo04;

/**
 * @author C-Q
 * @version 1.1.0
 * @Description: 这个人存钱
 * @date 2022/10/31
 */
public class PeopleExist implements Runnable{
    private Card card;

    public PeopleExist(Card card) {
        this.card = card;
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            card.setBalance(card.getBalance()+1000);
            System.out.println(Thread.currentThread().getName()+"往卡里充值了1000元，卡中的余额:"+card.getBalance());
        }
    }
}
